package com.bruan.d1_collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class CollectionTest3 {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        c.add("小的");
        c.add("好久");
        c.add("啊啊");
        c.add("但是");
        c.add("都是");
        c.add("电网");
        System.out.println(c);

        Iterator<String> it = c.iterator();
//        System.out.println(it.next());
//        System.out.println(it.next());
//        System.out.println(it.next());
//        System.out.println(it.next());
//        System.out.println(it.next());
//        System.out.println(it.next());

        while (it.hasNext()){
            String ele = it.next();
            System.out.println(ele);
        }
    }
}
